【Nuitka】python打包单文件

您所在的位置:网站首页 nuitka mac 【Nuitka】python打包单文件

【Nuitka】python打包单文件

2023-04-19 11:11| 来源: 网络整理| 查看: 265

1、官网

https://nuitka.net/

 

2、github

https://github.com/Nuitka/Nuitka

 

3、安装mingw64

https://winlibs.com/

 

4、创建python项目

以一个tk小例子

from tkinter import * root = Tk() root.wm_title('TK demo') wl = Label(root, text = 'hello world') wl.pack() root.mainloop()

 

5、安装

pip install nuitka

 

6、参数介绍

PS C:\Users\Administrator> nuitka --help Usage: __main__.py [--module] [--run] [options] main_module.py Options: --version show program's version number and exit -h, --help show this help message and exit --module Create an extension module executable instead of a program. Defaults to off. --standalone Enable standalone mode for output. This allows you to transfer the created binary to other machines without it using an existing Python installation. This also means it will become big. It implies these option: "--follow-imports" and "--python-flag=no_site". Defaults to off. --onefile On top of standalone mode, enable onefile mode. This means not a folder, but a compressed executable is created and used. Defaults to off. --python-debug Use debug version or not. Default uses what you are using to run Nuitka, most likely a non-debug version. --python-flag=FLAG Python flags to use. Default is what you are using to run Nuitka, this enforces a specific mode. These are options that also exist to standard Python executable. Currently supported: "-S" (alias "no_site"), "static_hashes" (do not use hash randomization), "no_warnings" (do not give Python runtime warnings), "-O" (alias "no_asserts"), "no_docstrings" (do not use doc strings), "-u" (alias "unbuffered") and "-m". Default empty. --python-for-scons=PATH If using Python3.3 or Python3.4, provide the path of a Python binary to use for Scons. Otherwise Nuitka can use what you run Nuitka with or a "scons" binary that is found in PATH, or a Python installation from Windows registry. --warn-implicit-exceptions Enable warnings for implicit exceptions detected at compile time. --warn-unusual-code Enable warnings for unusual code detected at compile time. --assume-yes-for-downloads Allow Nuitka to download external code if necessary, e.g. dependency walker, ccache, and even gcc on Windows. To disable, redirect input from nul device, e.g. "


【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3